<!--加载提示框-->
      	//状态标记
		var loading = true;
		var start = 0;//当前页
		var length = 3;//每页条数

		//列表加载数据
        $(function () {
			$("#loading").click(function () {
				start +=3;
				loadData(start, length);
			});
		})

		function loadData(start, length) {
			var url = "http://127.0.0.1:8080/getmeglist?";
		    $.get(url, {offset: start, limit: length}, function (Data, status) {
				// $("#showlist ul").empty();
				console.log(Data);
				if (Data.data.length > 0){
					var trhtml ="";
					for ( var i in Data.data) {

						//点赞判断
						var arr = [];
						for (var x in Data.thumbupIdList){
							M_val = Data.thumbupIdList[x].Message_id;
							arr.push(M_val);
						}
						var index = $.inArray(Data.data[i].M_id,arr);
						// alert(index);
						// alert(arr);
						if (index >= 0){
							heartClass='glyphicon-heart';
						}else{
							heartClass='glyphicon-heart-empty';
						}
						// console.log(byId2)
						trhtml += "<li class=\"list-group-item\">" +
							"<a href=\"#\" class='thumb_a'  id="+'collect'+Data.data[i].M_id+" style=\"float: right;\"><span id='"+Data.data[i].M_id+"' class='glyphicon "+heartClass+" thumbUpBtn ' style=\"color: rgb(255, 0, 0); font-size: 15px;\"></span></a>"+
							"<h2>" +
							" <b>" +
							"<a href=\"/threads/content?tid=8802571\" target=\"_blank\">"+Data.data[i].Hdline+
							"</a>" +
							"<em class=\"red\">待回复</em>" +
							"</b>" +
							"</h2>" +
							"<span class=\"badge\">新</span>" +
							"<h3 class=\"fl grey2 clearfix\">" +
							"<span>" +
							"***" +Data.data[i].Cr_time +
							"</span>" +
							"</h3>" +
							"<p>" +
							Data.data[i].Text +
							"<i class=\"red\"><a href=\"/threads/content?tid=8802571\" target=\"_blank\">[查看全文]</a></i>" +
							"</p>" +
							"</li>"
					}
					$("#showlist ul").append(trhtml);
					$(".thumbUpBtn").click(function (){
						alert(1);
						// console.log($(this));
						console.log($(this).attr("id"));
						$(this).toggleClass("glyphicon-heart-empty");
						$(this).toggleClass("glyphicon-heart");
						//check user cookies is login or need login
						// if login , then, thumbup
						// if no login then, login window open
						// ADD thumbup or delete thumbup
						//$ajax()
					});
				}else {
					$("#loading_div").html("<font color='#8b0000' size='3'>我是有底线的...</font>");
				}
			});

		}

		//点赞判断方法
		// function in_array(search,array){
		// 	for(var i in array){
		// 		if(array[i]==search){
		// 			return true;
		// 		}
		// 	}
		// 	return false;
		// }
		// 	$(".thumbUpBtn").click(function () {
		// 		alert("1");
		// 	$("#collect span").toggleClass("glyphicon-heart-empty");
		// 	$("#collect span").toggleClass("glyphicon-heart");
		// 	var value = $("#collect span").attr("class").length;
		// 	if (value == 25){
		// 		$("#collect span").text("已点赞");
		// 	}else {
		// 		$("#collect span").text("点赞");
		// 	}
        //
		// });

